<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>我的收益明细</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<link rel="shortcut icon" href="{$_W['siteroot']}/addons/lanye_wd/static/images/favicon.ico">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="{$_W['siteroot']}/addons/lanye_wd/static/css/light7.css">
		<link rel="stylesheet" href="{$_W['siteroot']}/addons/lanye_wd/static/css/icon.css">
		<link rel="stylesheet" href="{$_W['siteroot']}/addons/lanye_wd/static/css/style.css?v={$_W['timestamp']}">
	</head>
	<body>
		<div class="page page-current">
			<div class="content">
				<div class="buttons-tab">
					<a href="{php echo $this->createMobileUrl('user',array('op' => 'income'))}" class="button external {if $type == 2}active{/if}">贷款</a>
					<a href="{php echo $this->createMobileUrl('user',array('op' => 'income','type' => 1))}" class="button external {if $type == 1}active{/if}">信用卡</a>
					<a href="{php echo $this->createMobileUrl('user',array('op' => 'income','type' => 3))}" class="button external {if $type == 3}active{/if}">推广</a>
				</div>
				<div class="list-block media-list list-border-none no-margin">
					<ul id="data-box" attr-page="0"></ul>
				</div>
			    <div id="loadstat" class="infinite-scroll-preloader">
			        <div class="preloader"></div>
			    </div>
			    <div id="loadnext" class="infinite-scroll-loadnext">点击加载更多</div>
			</div>
			<nav class="bar bar-tab">
				<a class="tab-item external" href="{php echo $this->createMobileUrl('index')}">
					<span class="icon mdi mdi-home"></span>
					<span class="tab-label">办卡</span>
				</a>
				<a class="tab-item external" href="{php echo $this->createMobileUrl('news')}">
					<span class="icon mdi mdi-file-document"></span>
					<span class="tab-label">资讯</span>
				</a>
				<a class="tab-item external" href="{php echo $this->createMobileUrl('lend')}">
					<span class="icon mdi mdi-layers"></span>
					<span class="tab-label">用钱</span>
				</a>
				<a class="tab-item external active" href="{php echo $this->createMobileUrl('user')}">
					<span class="icon mdi mdi-account-circle"></span>
					<span class="tab-label">我的</span>
				</a>
			</nav>
		</div>
		<script id="logTemplate"  type="text/html">
			<li>
				<div class="item-content">
					<div class="item-inner">
						<div class="item-title-row">
							<div class="item-title">￥{{fan_level1}}元</div>
							<!-- <div class="item-after">{{status}}</div> -->
						</div>
						<div class="item-subtitle">{{createtime}}</div>
					</div>
				</div>
			</li>
		</script>
		<script src="{$_W['siteroot']}/addons/lanye_wd/static/js/jquery.js"></script>
		<script src="{$_W['siteroot']}/addons/lanye_wd/static/js/light7.js"></script>
		<script src="{$_W['siteroot']}/addons/lanye_wd/static/js/common.js?v={$_W['timestamp']}"></script>
		{php echo register_jssdk(false);} 
		<script>
			wx.ready(function () {
		        sharedata = {
		            title: "{$config['share_title']}",
		            desc: "{$config['share_desc']}",
		            link: "{$_W['siteroot']}{php echo $this->createMobileUrl('index',array('cc' => $_W['member']['uid']))}",
		            imgUrl: "{$_W['attachurl']}{$config['share_img']}",//本域链接
		        };
				wx.onMenuShareAppMessage(sharedata);
				wx.onMenuShareTimeline(sharedata);
				wx.onMenuShareQQ(sharedata);
				wx.onMenuShareQZone(sharedata);
				wx.onMenuShareWeibo(sharedata);
				getdata(1);
			});
			
			function getdata(page){
				var url = "{php echo $this->createMobileUrl('user',$filter)}";
				$("#loadstat").show();
				$("#loadnext").hide();
				$.post(url,{'page':page},function(response){
					console.log(response);
					if(response.code == 1){
						var gettpl = $("#logTemplate").html();
						$.each(response.result,function(key,data){
							var html = $.Template7(gettpl,data);
							var length = $("#data-box li").length;
							if(length < response.total){
								$("#data-box").append(html).attr("attr-page",page);
							}
							$("#loadstat").hide();
							$("#loadnext").show();
						});	
					}else{
						$("#loadnext").html(response.reason);	
						$("#loadstat").hide();
						$("#loadnext").show();
					}
				},'json');
			}
				
			$("#loadnext").click(function(){
				var p = parseInt($("#data-box").attr("attr-page")) + 1;
				getdata(p);
			});
			
		</script>
	</body>
</html>